<?php

namespace app\letterapi\controller;

use app\common\letterbusiness\Quicklogin as quickloginBn;
use app\common\letterbusiness\User as userBn;

class Quicklogin extends \app\common\controller\HomeBase {

    /**
     * 小程序登录
     */
    public function wxxcxlogin() {
        try {
            $post = input();
            if (!isset($post['code'])) {
                exception('登录失败', 110038);
            }
           
            $postdata = quickloginBn::checkWxXCX($post);
            //$post = $this->validate($post, 'QuickLogin.savequicklogin');
            $data = quickloginBn::savequicklogin($postdata);
            $this->_echoSuccessMessage('登陆成功', $data);
        } catch (\Exception $e) {
            $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }

}
